package com.atguigu04.block;

/**
 * ClassName: BlockTest
 * Package: com.atguigu04.block
 * Description:
 *
 * @Author 姜
 * @Create 2023/11/23 14:11
 * @Version 1.0
 */
public class BlockTest {
    public static void main(String[] args) {
//        Person p1 = new Person();
//        p1.eat();
        System.out.println(Person.info);
    }
}

class Person {
    String name;
    int age;
    static String info = "私密马赛";

    public void eat() {
        System.out.println("干饭");
    }

    public Person() {

    }

    // 非静态代码块
    {
        System.out.println("非静态代码块1");
    }

    // 静态代码块
    static {
        System.out.println("静态代码块1");
    }
}
